#include "FluVirus.h"
#include <stdlib.h>
FluVirus::FluVirus()
{
	cout<<"Constructor Flu class"<<endl;
	FluVirus::DoBorn();
	FluVirus::InitResistance();
	

}
FluVirus::FluVirus(const FluVirus &fluVirus):Virus(fluVirus)
{
	this->m_color = fluVirus.m_color;
	
}
FluVirus::~FluVirus()
{
	cout<<"Destructor FluVirus!!!"<<endl;
	FluVirus::DoDie();
}
void FluVirus::DoBorn()
{
	Virus::LoadDNAInformation();
	this->m_color = (((rand() % 2)) ? 0x0000FF : 0xFF0000);

}
list<Virus*> FluVirus::DoClone()const
{

	list<Virus*> listFlu;
	listFlu.push_back(new FluVirus(*this));
	cout<<"FluVirus clone!!!"<<endl;
	return listFlu;
}
int FluVirus::GetType()
{
	return FLUVIRUS;
}
void FluVirus::DoDie()
{
	
	//cout<<"FluVirus removed!!!"<<endl;
	delete[] m_dna;
	
 	
}
void FluVirus::InitResistance()
{
	if(this->m_color == 0x0000FF)
	{
		this->m_resistance = rand()%20 + 11;

	}
	else
	{
		this->m_resistance = rand()%15 + 11;

	}
}